package com.example.store.common;

//通过线程实现id在不同页面的获取
public class BaseContext {
    private static ThreadLocal<String> threadLocal = new ThreadLocal<>();

    //在filter转发时调用，将session中的”user“值保存下来
    public static void setCurrentId(String id){
        threadLocal.set(id);
    }

    //获取id
    public static String getCurrentId(){
        return threadLocal.get();
    }
}
